Skip to content

New Mellea post on LintQ for IVR - #80

Merged
ajbozarth merged 16 commits into
generative-computing:mainfrom
gretadolcetti:main
Oct 23, 2026
Merged

ajbozarth merged 16 commits into
generative-computing:mainfrom
gretadolcetti:main

Conversation

@gretadolcetti

@gretadolcetti gretadolcetti commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This pull request adds a new blog post, "Tests Pass, Smells Stay: Adding a Quantum Linter to Qiskit IVR," which describes integrating the LintQ quantum linter into the Mellea Instruct-Validate-Repair (IVR) loop for Qiskit code generation. The post explains how quantum-specific code smells can persist even after passing all tests and demonstrates how combining functional testing with quantum-aware static analysis significantly increases the share of generated programs that are both correct and free of quantum code smells.

Key additions and themes:

New Content: Quantum Linting in IVR

  • Introduces LintQ, a CodeQL-based static analyzer for Qiskit, and explains its integration into the Mellea IVR loop alongside functional tests.
  • Details specific quantum code smells detected by LintQ, such as applying gates after measurement and unused qubits, with a table of example rules.

Validation Pipeline and Implementation

  • Provides Python code snippets showing how correctness and LintQ validation are sequenced, ensuring only functionally correct programs are linted.
  • Explains how validation results are fed back into the repair loop, enabling iterative improvement of generated code.

Results and Impact

  • Presents experimental results on Qiskit HumanEval (hard) and Qiskit Quantum Katas

@gretadolcetti
gretadolcetti requested review from a team and ajbozarth as code owners October 8, 2026 08:58
@gretadolcetti
gretadolcetti requested a review from planetf1 October 8, 2026 08:58
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

@ajbozarth

@planetf1

planetf1 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Hi @gretadolcetti - thanks for blog post. great to have a quantum example. Just two quick things

a) I noticed the description stopped after 'Presents experimental results on Qiskit HumanEval (hard) and' - not a big deal but you might have wanted to put more

b) You need to 'signoff' on your commits. this is why DCO is failing. Since you only have one commit it's fairly easy to add it (for example read here

Will take a read

Signed-off-by: Greta <gretadolcetti@gmail.com>
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

Hi @planetf1, thanks for the feedback! I should have fixed both aspects.

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated

@planetf1 planetf1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gretadolcetti! I tried running the code (macOS, mellea 0.8.0) and left a few comments inline.

Comment thread content/blogs/qiskit-ivr-lintq.md
Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
Comment thread content/blogs/qiskit-ivr-lintq.md
Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
Signed-off-by: Greta <gretadolcetti@gmail.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

Thanks @planetf1 for the very quick and detailed review!

I believe I’ve addressed all your concerns in the latest fixes. Most of them stemmed from the fact that I intended the blog post not as a directly runnable example but as a didactic one, with pointers to the real code (in generative-computing/mellea#1716), where users can run it themselves and experiment, building on @ajbozarth’s existing example.

That said, I think your comments have improved the blog post a lot!

@ajbozarth ajbozarth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review generated by Claude. I'll do a separate manual pass through the blog myself.

Thanks @gretadolcetti — this is a great use of IVR, and a fun one to see written up. The code lines up with the current mellea APIs and the Results numbers match the example's benchmarking, so no concerns on accuracy.

Before this merges: the mellea example this links to may not include the LintQ code (see generative-computing/mellea#1716), so let's make sure the post doesn't depend on it — details inline. A few small copy nits inline as well.

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
Comment thread content/blogs/qiskit-ivr-lintq.md
Comment thread content/blogs/qiskit-ivr-lintq.md
Comment thread content/blogs/qiskit-ivr-lintq.md
gretadolcetti and others added 5 commits October 14, 2026 09:52
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
Signed-off-by: Greta <gretadolcetti@gmail.com>
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

Hi @ajbozarth, thanks for the feedback and suggestions!
I should have clarified all the points that you mentioned.

@ajbozarth ajbozarth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from Claude — the broken paragraph below came from a mis-anchored suggestion in Claude's earlier review, not your edits. Apologies for the churn.

The LintQ-paper citation and the CodeHelm note both look right. One leftover to fix, inline.

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated

@ajbozarth ajbozarth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from Claude.

One suggestion on the paper citation, inline.

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
gretadolcetti and others added 2 commits October 15, 2026 10:01
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

@gretadolcetti — this PR is scheduled to merge on 2026-10-15. Please enable auto-merge manually so it goes through the merge queue with CI.

@ajbozarth

Copy link
Copy Markdown
Member

I do believe this looks good pending what happens with generative-computing/mellea#1716, either way we'll need to update the release date, I would suggest updating it to next Monday for now

Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

Thanks @ajbozarth for the positive review, I updated the release date to Monday 19th of October.

@github-actions

Copy link
Copy Markdown

@gretadolcetti — this PR is scheduled to merge on 2026-10-15. Please enable auto-merge manually so it goes through the merge queue with CI.

3 similar comments
@github-actions

Copy link
Copy Markdown

@gretadolcetti — this PR is scheduled to merge on 2026-10-15. Please enable auto-merge manually so it goes through the merge queue with CI.

@github-actions

Copy link
Copy Markdown

@gretadolcetti — this PR is scheduled to merge on 2026-10-15. Please enable auto-merge manually so it goes through the merge queue with CI.

@github-actions

Copy link
Copy Markdown

@gretadolcetti — this PR is scheduled to merge on 2026-10-15. Please enable auto-merge manually so it goes through the merge queue with CI.

@ajbozarth

Copy link
Copy Markdown
Member

I've removed the remind from the description so the bot stop posting everyday. I am still actively reviewing both this and more so the example PR to actually test run them manually and validate the readme and blog steps (slow due to low bandwidth). Once the other PR is merged we can update the date on this and release it.

@ajbozarth ajbozarth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my recent comment on the example PR generative-computing/mellea#1716 (comment) I think we can unblock this with some minor tweaks and post it tomorrow.

And sorry for the delays in reviewing the PRs

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated

```python
from mellea.stdlib.requirements import req, simple_validate
from validation_helpers import extract_code_from_markdown, validate_correctness, validate_lintq

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a huge issue given you define it in a code block below, but technically validate_lintq won't be in validation_helpers after addressing my review in the example PR. We can probably leave it as is, but if you have a better way of writing the import it may be clearer to a reader

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread content/blogs/qiskit-ivr-lintq.md Outdated
gretadolcetti and others added 2 commits October 23, 2026 08:37
Co-authored-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
Signed-off-by: Greta Dolcetti <53076361+gretadolcetti@users.noreply.github.com>
@gretadolcetti

Copy link
Copy Markdown
Contributor Author

Perfect, @ajbozarth. I should have addressed all of your last comments.

@AngeloDanducci AngeloDanducci left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, easy to follow, generally looks good! I'll let Alex give final approval as he's been more involved.

@ajbozarth
ajbozarth enabled auto-merge October 23, 2026 18:56
@ajbozarth
ajbozarth added this pull request to the merge queue Oct 23, 2026
Merged via the queue into generative-computing:main with commit a9206e0 Oct 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants